﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SerialPortLibrary
{
    public class SerialPortFactory
    {
        public static IDataBuffer CreateDataBuffer(IDataPublish publish)
        {
            return new DataBuffer(publish);
        }

        public static ISerialPort CreateSerialPort(string COM, int BaudRate, Parity Parity, int DataBits, StopBits StopBit)
        {
            return new SerialPort(COM, BaudRate, Parity, DataBits, StopBit);
        }

        public static IDriver CreateDriver(IDataPublish publish)
        {
            return new StandardModbusDriver(publish);
        }

        public static ISerialData CreateData()
        {
            return new StandardModbusSerialData();
        }
    }
}
